package com.bw.doctor.controller;/**
 * @Author：尚志豪
 * @Package：com.bw.doctor.controller
 * @Project：doudi-group2-shixun-02
 * @name：PharmacyHistoricalPrescriptionController
 * @Date：2025/2/25 20:29
 */

import com.bw.common.core.domain.Result;
import com.bw.common.core.web.controller.BaseController;
import com.bw.doctor.domain.Restoratives;
import com.bw.doctor.domain.res.HistoricalPrescriptionRes;
import com.bw.doctor.service.PharmacyHistoricalPrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: doudi-group2-shixun-02
 * @description: 我的药房历史处方
 * @author: CuiFu Bo
 * @create: 2025-02-25 20:29
 **/
@RestController
@RequestMapping("/pharmacyHistoricalPrescription")
public class PharmacyHistoricalPrescriptionController extends BaseController
{

    @Autowired
    private PharmacyHistoricalPrescriptionService pharmacyHistoricalPrescriptionService;

    /**
     * B端 我的药房 历史处方列表
     */
    @PostMapping("/listOfHistoricalPrescriptions")
    public Result listOfHistoricalPrescriptions(Long doctorId)
    {
        startPage();
        List<HistoricalPrescriptionRes> list = pharmacyHistoricalPrescriptionService.listOfHistoricalPrescriptions(doctorId);
        return getDataTable(list);
    }

    /**
     * B端 我的药房 历史处方详情
     */
    @PostMapping("/historicalPrescriptionDetails")
    public Result<HistoricalPrescriptionRes> historicalPrescriptionDetails(Long id, Long doctorId)
    {
        HistoricalPrescriptionRes historicalPrescriptionRes = pharmacyHistoricalPrescriptionService.historicalPrescriptionDetails(id,doctorId);
        return Result.success(historicalPrescriptionRes);
    }
}
